#include <iostream>
#include <vector>

using namespace std;
//非常离谱，如果输出n个数据，你的数组刚好只有n个空间它会报错，你需要数组1000
int* solve(int N, int M, int K)
{
    int tmp[1000] = { 0 };
    int index2 = 0;
    vector<int> people(N);
    for (int i = 0; i < N; i++) {
        people[i] = i + 1;
    }//这几个人分别的序号要加一

    int index = 0;
    while (people.size() > K)//只要比k个人多
    {
        index = (index + M - 1) % people.size();
        tmp[index2] = people[index];
        index2++;
        people.erase(people.begin() + index);
    }
    return tmp;
}
